home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / HippoDraw / hippo / architecture next >
Encoding:
Text File  |  1992-04-28  |  1.6 KB  |  105 lines

  1. #!/bin/sh
  2.  
  3. # $Id: architecture,v 3.4 1992/03/03 18:05:00 rensing Rel $
  4. #
  5. # Copyright (C)  1992  The Board of Trustees of The Leland Stanford
  6. # Junior University.  All Rights Reserved.
  7.  
  8.  
  9. # simple way of overriding all other tests
  10. if test -n "$ARCH"; then
  11.    echo $ARCH
  12.    exit 0
  13. fi
  14.  
  15. if test -n "${HOSTTYPE}"; then
  16.    case "${HOSTTYPE}" in
  17.       rs6000)
  18.          echo aix6000 ;;
  19.       decstation)
  20.          echo ultrix ;;
  21.       iris4d)
  22.          echo sgi ;;
  23.       *)
  24.          echo ${HOSTTYPE} ;;
  25.    esac
  26.    exit 0
  27. fi
  28.  
  29. cat /etc/motd | grep ULTRIX >/dev/null
  30. if test $? -eq 0; then
  31.    echo ultrix
  32.    exit 0
  33. fi
  34.  
  35. cat /etc/motd | grep -i AIX >/dev/null
  36. if test $? -eq 0; then
  37.    echo aix6000
  38.    exit 0
  39. fi
  40.  
  41. cat /etc/motd | grep -i SunOS >/dev/null
  42. if test $? -eq 0; then
  43.    echo sun4
  44.    exit 0
  45. fi
  46.  
  47. /bin/4d > /dev/null 2> /dev/null
  48. if test $? -eq 0; then
  49.    echo sgi
  50.    exit 0
  51. fi
  52.  
  53. /bin/arch > /dev/null 2> /dev/null
  54. if test $? -eq 0; then
  55.    echo `/bin/arch`
  56.    exit 0
  57. fi
  58.  
  59. /bin/uname > /dev/null 2> /dev/null
  60. if test $? -eq 0; then
  61.    case "`/bin/uname`" in
  62.       SunOS)
  63.          echo sun4 ;;
  64.       AIX)
  65.          echo aix6000 ;;
  66.       ULTRIX)
  67.          echo ultrix ;;
  68.       SGI)
  69.          echo sgi ;;
  70.       *)
  71.          echo `/bin/uname` ;;
  72.    esac
  73.    exit 0
  74. fi
  75.  
  76. # The Next is a pain
  77. # no uname, no motd, arggh
  78. hostinfo > /dev/null 2>/dev/null
  79. if test $? -eq 0; then
  80.    hostinfo |grep -i NeXT > /dev/null 2> /dev/null
  81.    if test $? -eq 0; then
  82.       echo next
  83.       exit 0
  84.    fi
  85. fi
  86.  
  87. if test -d /NextLibrary; then
  88.    echo next
  89.    exit 0
  90. fi
  91.  
  92. if test -f /usr/bin/dread; then
  93.    echo next
  94.    exit 0
  95. fi
  96.  
  97. if test -f /etc/svc.conf; then
  98.    echo ultrix
  99.    exit 0
  100. fi
  101.  
  102. exit 1
  103.  
  104.  
  105.